Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

223
Vistas
How to detect the "closed_by_user" event via the new "Google 3P Authorization JavaScript Library API"

I'm currently using the Google Sign-In JavaScript Platform Library for web. Via the grantOfflineAccess() function I request access to scopes from the users Google account with ux_mode: 'popup'.

auth2.grantOfflineAccess().then(
  response => {
    // response handling 
  },
  error => {
    // error handling
  },
)

Currently I'm able to detect if the popup is closed without authorization, because the error callback is called with this data:

{
  error: "popup_closed_by_user"
}

As Google is discontinuing this Sign-In API I'm migrating to the new Google 3P Authorization JavaScript Library

As part of the migration, I have modified the authorization flow to code like this:

google.accounts.oauth2.initCodeClient({
  client_id: '[...].apps.googleusercontent.com',
  fetch_basic_profile: false,
  ux_mode: 'popup',
  scope: '[...]',
  callback: response => {
    // handle google feedback
  },
}).requestCode()

As the docs state, the callback can have the parameters code, scope, state, error, error_description, error_uri and I expected it to be the equivalent of the previous callbacks, but it does not seem to be called for the popup_closed_by_user event.

Unfortunately, I was also not able to find an alternative callback.

Is someone aware wether the popup_closed_by_user event can be detected with the new library?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda